
package me.zhengjie.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author IQW
* @date 2022-07-18
**/
@Entity
@Data
@Table(name="app_daka")
public class AppDaka implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "dk_id")
    @ApiModelProperty(value = "ID")
    private Integer dkId;

    @Column(name = "area_id")
    @ApiModelProperty(value = "责任区ID")
    private Integer areaId;

    @Column(name = "user_id")
    @ApiModelProperty(value = "用户ID")
    private Integer userId;

    @Column(name = "title")
    @ApiModelProperty(value = "上班卡或下班卡")
    private String title;

    @Column(name = "stime")
    @ApiModelProperty(value = "规定打卡时间")
    private String stime;

    @Column(name = "num")
    @ApiModelProperty(value = "2或4个时间点")
    private Integer num;
    //
    @Column(name = "flag")
    @ApiModelProperty(value = "打卡标记1上班1，2下班1，3上班2，4下班2")
    private Integer flag;

    @Column(name = "json")
    @ApiModelProperty(value = "打卡JSON")
    private String json;

    @Column(name = "status")
    @ApiModelProperty(value = "状态  0缺卡，1正常，2早退，3迟到")
    private Integer status;

    @Column(name = "create_time")
    @ApiModelProperty(value = "createTime")
    private Timestamp createTime;

    @Column(name = "update_time")
    @ApiModelProperty(value = "updateTime")
    private Timestamp updateTime;

    public void copy(AppDaka source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}